///网络异常统一格式类
class HiNetError implements Exception {
  final int code;
  final String message;
  final dynamic data;
  HiNetError(this.code, this.message, {this.data});

  @override
  String toString() {
    return 'HiNetError{code: $code, message: $message, data: $data}';
  }
}

///需要登录的异常
class NeedLogin extends HiNetError {
  NeedLogin({int code: 401, String message: "请先登录"}) : super(code, message);
}

///需要授权
class NeedAuth extends HiNetError {
  NeedAuth({int code: 403, String message: "权限认证失败"}) : super(code, message);
}